{extend name="default/template/base_index" /}

{block name="area_header"}
<script type="text/javascript" src="__CDN__/jquery-datetimepicker/jquery.datetimepicker.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="__CDN__/jquery-datetimepicker/jquery.datetimepicker.css">
{/block}

{block name="area_body"}
	{include file="default/Widget/topbar" /}
	<div class="admin-main container-fluid">
		{include file="default/Widget/left" /}
		<div class="admin-main-content">
			{include file="default/Widget/breadcrumb" /}
			<div class="table-responsive well">
	<!-- 过滤\查询按钮 -->
	<div class="filter-controls">
		<form action="{:url('SunsunFilterVat/index')}" class="memberForm form-inline" method="post">
			<div class="form-group">
				<label class="control-label">设备id</label>
				<div class="input-group">
					<input class="form-control"  type="text" name="did" placeholder="请输入设备id" value="{$did}"/>
				</div>
			</div>

			<div class="form-group">
				<label class="control-label">设备版本</label>
				<select name="version" class="form-control" >
					<option value="">=全部=</option>
					{volist name="filterVer" id="vo"}
					<option {eq name="vo['version']" value="$version"}selected{/eq} value="{$vo.version}">{$vo.version}</option>
					{/volist}
				</select>
			</div>
			<div class="form-group ">
				<div class="input-group">
					<div class="input-group-addon input-sm">
						时间
						<i class="fa fa-calendar"></i>
					</div>
					<input type="text" name="startdatetime" id="startdatetime" class="form-control input-short input-sm" value="{$startdatetime}" />
					<div class="input-group-addon input-sm">
						<i class="fa fa-long-arrow-right"></i>
					</div>
					<input type="text" name="enddatetime" id="enddatetime" class="form-control input-short input-sm" value="{$enddatetime}" />
				</div>
				<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-search"></i>{:L('BTN_SEARCH')}</button>
			</div>
			<!--<div class="form-group">-->
				<!--<label class="control-label">&nbsp;</label>-->
				<!--<div class="input-group">-->
					<!--<button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>查询</button>-->
				<!--</div>-->
			<!--</div>-->
		</form>
	</div>


	<table class="table table-striped table table-hover  table-condensed">
		<thead>
			<tr>
				<th style="width:40px;">							
					<input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" /> 
				</th>
				<th>
					设备唯一ID
				</th>
				<th>
					设备版本
				</th>
				<th>
					密码
				</th>
				<th>
					控制密码
				</th>
				<th>
					最近登录IP
				</th>
				<th>
					最近登录时间
				</th>
				<th>
					心跳周期
				</th>
				<th>
					更新进度
				</th>
				<th>
					更新状态
				</th>
			</tr>
		</thead>
		<tbody>
			{empty name="list"}
				<tr>
					<td colspan="8" class="text-center">{:L('NO_DATA')}</td>
				</tr>
				{else/}
				{volist name="list" id="vo"}
					<tr>
						<td><input type="checkbox" value="{$vo.did}" name="did[]" class="selectitem" /></td>

						
						<td><a href="{:url('Admin/SunsunFilterVat/detail',array('did'=>$vo['did']))}?ret_url=__SELF__" >{$vo.did}</a></td>
						<td>{$vo.ver}</td>
						<td>{$vo.pwd}</td>
						<td>{$vo.ctrl_pwd}</td>
						<td>{$vo.last_login_ip}</td>
						<td>{:toDatetime($vo['last_login_time'])}</td>
						<td>{$vo.hb}</td>
						{switch name="$vo.upd_state"}
						{case value="0"}<td>正常</td>{/case}
						{case value="101"}<td>更新失败</td>{/case}
						{default /}<td>{$vo.upd_state}%</td>
						{/switch}
						<td>{$vo.device_state}</td>

				{/volist}
			{/empty}
		</tbody>
	</table>
	<div>{$show}</div>
</div>
		</div>
		<!-- END admin-main-content -->
	</div>
		<!-- END admin-main-->
<script type="text/javascript">
	$(function() {

		$('#startdatetime').datetimepicker({
			lang: 'ch',
			format:'Y-m-d H:i:s',
			// format:'Y-m-d',
			// timepicker:false,
		});
		$('#enddatetime').datetimepicker({
			lang: 'ch',
			format:'Y-m-d H:i:s',
		});
	});
</script>
{/block}

{block name="area_footer"}

{/block}
